/*
 * @Author: 张文韬
 * @Date: 2022-6-13 13:42:38
 * @LastEditors: 张文韬
 * @LastEditTime: 2024-07-16 14:03:53
 * @Description: file content
 */

import { 
  createInput, 
  createSelect,
  createDateSelect
} from "@/utils/e-components.tool"

export const editFormRules = {
  name: [
    { required: true, message: '请输入被保险人姓名', trigger: 'blur' }
  ],
  certificateNo: [
    { required: true, message: '请输入证件号码', trigger: 'blur' },
  ],
  phone: [
    // { required: true, message: '请输入手机号码', trigger: 'blur' },
    // { type:'number', message: '手机号码格式错误', }
  ]
};


export const editFormOptions = [
  createInput('姓名', 'name').setSpan(24).option(),
  createSelect('证件类型', 'certificateType')
    .setProps({clearable: false})
    .setOptions([{ label: '身份证', value: '0' },{ label: '普通护照', value: '1' }])
    .setChanged('cardTypeChange')
    .setSpan(10)
    .option(),
  createInput('证件号码', 'certificateNo')
    .setOnBlur('cardNumberChange')
    .setSpan(14)
    .option(),
  // createInput('年龄', 'age').setProps({disabled: true}).setSpan(12).option(),
  createDateSelect('出生日期', 'birthday')
    .setProps({type: 'date', disabled: true, valueFormat: 'YYYY-MM-DD'})
    .setChanged('birthChange')
    .setSpan(12)
    .option(),
  createSelect('性别', 'gender')
    .setOptions([{ label: '女', value: '女' },{ label: '男', value: '男' }])
    .setProps({disabled: true})
    .setSpan(12)
    .option(),
  createSelect('关系', 'relationshipWithApplicant').setSpan(12).option(),
  createSelect('比例', 'rate').setSpan(12).option(),
]
